package com.demo2;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.context.annotation.Bean;import org.springframework.stereotype.Controller;@Controllerpublic class StudentController {    @Bean(name = {"stu1"})    public Student getStudent()    {        Student student = new Student(1,"张三",18);        return student;    }    @Bean(name = {"stu2"})    public Student2 getStudent2()    {        Student2 student = new Student2(2,"李四",45);        return student;    }}